#x + y = 35
#2x + 4y = 94

total = 35
legs = 94

for x in range(1, total + 1):
    if (total - x) * 4 + x * 2 == legs:
        print("笼中鸡有", x, "只，兔子有", total - x, "只")